﻿Public Class FrmResults

  Sub SetResultDataSet(resultItems As System.Collections.Generic.List(Of ResultItem))

    For Each ri As ResultItem In resultItems
      Dim lvi As New ListViewItem()
      lvi.Text = ri.SourceProjectName
      lvi.SubItems.Add(ri.TargetProjectName)
      lvi.SubItems.Add(ri.Name)
      lvi.SubItems.Add(ri.Type)
      lvi.SubItems.Add(ri.DTESubType)
      lvi.SubItems.Add(ri.Result)
      lvi.SubItems.Add(ri.FullPath)

      Dim l = ri.Result.ToLower()
      If l = "linked" OrElse l = "created" Then
        lvi.BackColor = Drawing.Color.LightGreen
      ElseIf l = "exists" Then
        lvi.BackColor = System.Drawing.Color.FromArgb(200, 200, 200)
      ElseIf ri.Result.ToLower().Contains("error") Then
        lvi.BackColor = System.Drawing.Color.FromArgb(255, 200, 200)
      End If

      lvw.Items.Add(lvi)
    Next

  End Sub

End Class